<!DOCTYPE html>
<html lang="en">

<head>
	<meta http-equiv="content-type" content="text/html; charset=utf-8">
	<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport">
	
	<!-- title -->
	
	<title>
	
		Dynamic 365 | 
	 
	小王的博客
	</title>
	
	<!-- keywords,description -->
	 

	<!-- favicon -->
	
	<link rel="shortcut icon" href="/wl/favicon.ico">
	


	<!-- search -->
	<script>
		var searchEngine = "https://www.google.com/search?q=";
		if(typeof searchEngine == "undefined" || searchEngine == null || searchEngine == ""){
			searchEngine = "https://www.google.com/search?q=";
		}
		var homeHost = "wujun234.github.io";
		if(typeof homeHost == "undefined" || homeHost == null || homeHost == ""){
			homeHost = window.location.host;
		}
	</script>


	
<link rel="stylesheet" href="/wl/css/main.css">

	
<link rel="stylesheet" href="https://cdn.staticfile.org/font-awesome/4.7.0/css/font-awesome.min.css">

	
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@9.17.1/build/styles/darcula.min.css">

	
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/fancyapps/fancybox@3.5.7/dist/jquery.fancybox.min.css">


	
<script src="https://cdn.jsdelivr.net/npm/jquery@3.5.1/dist/jquery.min.js"></script>

	
<script src="https://cdn.jsdelivr.net/gh/fancyapps/fancybox@3.5.7/dist/jquery.fancybox.min.js"></script>

	
<script src="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@9.17.1/build/highlight.min.js"></script>

	
<script src="https://cdn.jsdelivr.net/npm/jquery-pjax@2.0.1/jquery.pjax.min.js"></script>

	
<script src="/wl/js/main.js"></script>

	
		
<script src="https://cdn.jsdelivr.net/npm/leancloud-storage/dist/av-min.js"></script>

		
<script src="https://cdn.jsdelivr.net/npm/valine@v1.4.14/dist/Valine.min.js"></script>

	
	
		<script async src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>
	
<meta name="generator" content="Hexo 5.4.2"></head>

<body>
	<script>
var _hmt = _hmt || [];
(function() {
  var hm = document.createElement("script");
  hm.src = "https://hm.baidu.com/hm.js?3efe99c287df5a1d6f0d02d187e403c1";
  var s = document.getElementsByTagName("script")[0]; 
  s.parentNode.insertBefore(hm, s);
})();
</script>

<header id="header">
    <a id="title" href="/wl/" class="logo">小王的博客</a>

	<ul id="menu">
		<li class="menu-item">
			<a href="/about" class="menu-item-link">ABOUT</a>
		</li>
	

	

		<li class="menu-item">
			<a href="https://github.com/wujun234/uid-generator-spring-boot-starter" class="menu-item-link" target="_blank">
				UidGenerator
			</a>
		</li>
		<li class="menu-item">
			<a href="https://github.com/wujun234" class="menu-item-link" target="_blank">
				<i class="fa fa-github fa-2x"></i>
			</a>
		</li>
	</ul>
</header>

	
<div id="sidebar">
	<button id="sidebar-toggle" class="toggle" ><i class="fa fa-arrow-right " aria-hidden="true"></i></button>
	
	<div id="site-toc">
		<input id="search-input" class="search-input" type="search" placeholder="按回车全站搜索">
		<div id="tree">
			

			
							<ul>
								<li class="file">
									<a href="/wl/2023/02/24/C#%E5%B8%B8%E7%94%A8%E7%9A%84dynamic%20365%E6%96%B9%E6%B3%95/">
                     
										    C#常用的dynamic 365方法
                     
									</a>
								</li>
								<div class="article-toc" style="display: none;"></div>
							</ul>
			
							<ul>
								<li class="file active">
									<a href="/wl/2022/11/30/Dynamic-365/">
                     
										    Dynamic-365
                     
									</a>
								</li>
								<div class="article-toc" style="display: none;"></div>
							</ul>
			
							<ul>
								<li class="file">
									<a href="/wl/2023/02/24/Element%20UI%20%E9%80%9F%E9%80%9A/">
                     
										    Element UI 速通
                     
									</a>
								</li>
								<div class="article-toc" style="display: none;"></div>
							</ul>
			
							<ul>
								<li class="file">
									<a href="/wl/2022/11/28/Markdown%E8%AF%AD%E6%B3%95/">
                     
										    Markdown语法
                     
									</a>
								</li>
								<div class="article-toc" style="display: none;"></div>
							</ul>
			
							<ul>
								<li class="file">
									<a href="/wl/2023/02/24/%E5%89%8D%E7%AB%AF%E9%81%87%E5%88%B0%E7%9A%84%E9%97%AE%E9%A2%98/">
                     
										    前端遇到的问题
                     
									</a>
								</li>
								<div class="article-toc" style="display: none;"></div>
							</ul>
			
							<ul>
								<li class="file">
									<a href="/wl/2023/02/24/%E5%B8%B8%E7%94%A8XRM%E5%AF%B9%E8%B1%A1/">
                     
										    常用XRM对象
                     
									</a>
								</li>
								<div class="article-toc" style="display: none;"></div>
							</ul>
			
							<ul>
								<li class="file">
									<a href="/wl/2023/02/24/%E6%8F%92%E4%BB%B6%E9%81%87%E5%88%B0%E7%9A%84%E9%97%AE%E9%A2%98/">
                     
										    插件遇到的问题
                     
									</a>
								</li>
								<div class="article-toc" style="display: none;"></div>
							</ul>
			
							<ul>
								<li class="file">
									<a href="/wl/2023/02/24/%E6%9C%AC%E5%9C%B0%E5%AE%89%E8%A3%85vm%E9%81%87%E5%88%B0%E9%97%AE%E9%A2%98%E7%AC%94%E8%AE%B0/">
                     
										    本地安装vm遇到问题笔记
                     
									</a>
								</li>
								<div class="article-toc" style="display: none;"></div>
							</ul>
			
							<ul>
								<li class="file">
									<a href="/wl/2023/02/24/%E7%97%9B%E7%88%B1IT/">
                     
										    痛爱IT
                     
									</a>
								</li>
								<div class="article-toc" style="display: none;"></div>
							</ul>
			
							<ul>
								<li class="file">
									<a href="/wl/2022/11/27/%E8%87%B3%E8%87%AA%E5%B7%B1/">
                     
										    至自己
                     
									</a>
								</li>
								<div class="article-toc" style="display: none;"></div>
							</ul>
			
		</div>
	</div>
</div>

	<!-- 引入正文 -->
	<div id="content">
		<h1 id="article-title">
	Dynamic 365
</h1>
<div class="article-meta">
	
	<span>John Doe</span>
	<span>2022-11-30 20:15:26</span>
		<div id="article-categories">
    
		<span>Categories：</span>
            
    

    
		<span>Tags：</span>
            
    
		</div>

</div>

<div id="article-content">
	<h1 id="Dynamic-365-Web前端服务对象"><a href="#Dynamic-365-Web前端服务对象" class="headerlink" title="Dynamic 365 Web前端服务对象"></a>Dynamic 365 Web前端服务对象</h1><h2 id="1-窗体对象"><a href="#1-窗体对象" class="headerlink" title="1 .窗体对象"></a>1 .窗体对象</h2><ul>
<li>**<code>OnLoad</code>**事件：加载窗体后触发的事件，他无法阻止加载窗体。</li>
<li>**<code>OnSave</code>**事件：提交事件。</li>
<li>**<code>OnChange</code>**事件：在数据发生更改时执行。</li>
<li>**<code>OnProcessStatusChange</code>**事件：当流程发生问题时，系统执行的事件。</li>
</ul>
<h2 id="2-上下文引用"><a href="#2-上下文引用" class="headerlink" title="2. 上下文引用"></a>2. 上下文引用</h2><ul>
<li><p>在引用时需要引用**<code>Xrm.Page.context</code>**。</p>
</li>
<li><p>**<code>getClientUrl</code>**返回基本的URL<img src="C:\Users\29310\AppData\Roaming\Typora\typora-user-images\image-20221129193302329.png" alt="image-20221129193302329"></p>
</li>
<li><p>**<code>getCurrentTheme</code>**返回当前的主题<img src="C:\Users\29310\AppData\Roaming\Typora\typora-user-images\image-20221129193507632.png" alt="image-20221129193507632"></p>
</li>
<li><p>**<code>getisAutoSaveEnabled</code>**返回是否对组织自动保存<img src="C:\Users\29310\AppData\Roaming\Typora\typora-user-images\image-20221129193757513.png" alt="image-20221129193757513"></p>
</li>
<li><p>**<code>getOrgLcid</code>**返回组织基本语言代码标识符(<code>LCID</code>)值<img src="C:\Users\29310\AppData\Roaming\Typora\typora-user-images\image-20221129194048388.png" alt="image-20221129194048388"></p>
</li>
<li><p>**<code>getORgUniqueName</code>**返回组织名称唯一文本值<img src="C:\Users\29310\AppData\Roaming\Typora\typora-user-images\image-20221129220154111.png" alt="image-20221129220154111"></p>
</li>
<li><p>**<code>getQueryStringParameters</code>**返回返回表示查询字符串参数（该参数被传递到页面）的键值对的词典对象<img src="C:\Users\29310\AppData\Roaming\Typora\typora-user-images\image-20221129195638504.png" alt="image-20221129195638504"></p>
</li>
<li><p>**<code>getTimeZoneOffsetMinutes</code>**返回本地时与协调世界时 (UTC) 之间的时差<img src="C:\Users\29310\AppData\Roaming\Typora\typora-user-images\image-20221129213604125.png" alt="image-20221129213604125"></p>
</li>
<li><p>**<code>getUserId</code><strong>返回当前用户id的</strong><code>GUID</code>**值</p>
</li>
</ul>
<p><img src="C:\Users\29310\AppData\Roaming\Typora\typora-user-images\image-20221129213805011.png" alt="image-20221129213805011"></p>
<ul>
<li>**<code>getUserName</code>**返回当前用户名称</li>
</ul>
<p><img src="C:\Users\29310\AppData\Roaming\Typora\typora-user-images\image-20221129220042358.png" alt="image-20221129220042358"></p>
<ul>
<li>**<code>getUserRoles</code>**返回表示每个安全角色 GUID 值的字符串数组，其中安全角色与用户关联或与用户相关的任何团队关联。</li>
</ul>
<p><img src="C:\Users\29310\AppData\Roaming\Typora\typora-user-images\image-20221129220051551.png" alt="image-20221129220051551"></p>
<h2 id="3-Xrm-page-data对象"><a href="#3-Xrm-page-data对象" class="headerlink" title="3. Xrm.page.data对象"></a>3. <code>Xrm.page.data对象</code></h2><ul>
<li><p><strong><code>Xrm.Page.data.save().then(function () &#123;parent.window.location.reload();&#125;);</code></strong> 保存窗体和刷新。</p>
</li>
<li><p>**<code>Xrm.Page.data.entity </code>**方法</p>
<ul>
<li><p>**<code>attributes</code>**返回窗体所有记录<img src="C:\Users\29310\AppData\Roaming\Typora\typora-user-images\image-20221130074830564.png" alt="image-20221130074830564"></p>
</li>
<li><p>**<code>getDataXml</code>**返回表示当保存记录时将被发送到服务器的 XML 的字符串。 只有字段中已更改的数据被设置到服务器<img src="C:\Users\29310\AppData\Roaming\Typora\typora-user-images\image-20221130075335131.png" alt="image-20221130075335131"></p>
</li>
<li><p>**<code>getEntityName</code>**返回实体记录的逻辑字符串<img src="C:\Users\29310\AppData\Roaming\Typora\typora-user-images\image-20221130075533263.png" alt="image-20221130075533263"></p>
</li>
<li><p>**<code>getId</code>**返回表示记录的 GUID id 值的字符串<img src="C:\Users\29310\AppData\Roaming\Typora\typora-user-images\image-20221130080249045.png" alt="image-20221130080249045"></p>
</li>
<li><p>**<code>getIsDirty</code>**返回一个布尔值条件为是否修改任何字段<img src="C:\Users\29310\AppData\Roaming\Typora\typora-user-images\image-20221130080502554.png" alt="image-20221130080502554"></p>
</li>
<li><p>**<code>addOnSave(函数名称)</code>**当记录保存时添加执行的函数</p>
</li>
<li><p>**<code>removeOnSave(函数名称)</code>**当记录保存时删除的函数</p>
</li>
<li><p>**<code>getPrimaryAttributeValue</code>**返回主键值<img src="C:\Users\29310\AppData\Roaming\Typora\typora-user-images\image-20221130081342781.png" alt="image-20221130081342781"></p>
</li>
<li><p>**<code>save</code>**如果不包含参数，则将仅保存记录。 这等同于使用保存命令，saveandclose这等同于使用保存并关闭命令，saveandnew这等同于使用保存并新建命令。</p>
</li>
</ul>
</li>
<li><p><strong><code>Xrm.page.data 实体属性</code></strong></p>
<ul>
<li><strong><code>getAttribute</code></strong><ul>
<li>**<code>getValue</code>**返回列的值<img src="C:\Users\29310\AppData\Roaming\Typora\typora-user-images\image-20221130083026619.png" alt="image-20221130083026619"></li>
<li>**<code>getSet</code>**给字段赋值。</li>
<li>**<code>setDisabled</code>**上锁<img src="C:\Users\29310\AppData\Roaming\Typora\typora-user-images\image-20221130092750894.png" alt="image-20221130092750894"></li>
<li><strong><code>setVisible显示或者隐藏字段</code></strong><img src="C:\Users\29310\AppData\Roaming\Typora\typora-user-images\image-20221130092332584.png" alt="image-20221130092332584"></li>
<li><code>getInitialValue()</code>返回表示 OptionSet 或 Boolean 属性值设置的值。</li>
<li>**<code>getOption(value)</code>**返回带有传递到方法的参数匹配值的选项对象。</li>
<li>**<code>getOptions</code>**返回代表选项集属性有效选项的一组选项对象。</li>
<li>**<code>getSelectedOption</code>**返回在选项集属性中所选的选项对象。</li>
<li>**<code>getText</code>**返回选项集属性当前所选选项文本的字符串值。</li>
<li>**<code>getAttributeType()</code>**返回当前列的类型<img src="C:\Users\29310\AppData\Roaming\Typora\typora-user-images\image-20221130084427069.png" alt="image-20221130084427069"></li>
<li>**<code>getFormat</code>**返回代表属性格式类型的字符串值<img src="C:\Users\29310\AppData\Roaming\Typora\typora-user-images\image-20221130084624815.png" alt="image-20221130084624815"></li>
<li>**<code>getIsDirty</code>**2。<img src="C:\Users\29310\AppData\Roaming\Typora\typora-user-images\image-20221130084948399.png" alt="image-20221130084948399"></li>
<li>**<code>getIsPartyList</code>**返回一个布尔值，指示查找是否表示 partylist 查找。 Partylist 查找允许设置多条记录，布尔。 若属性查找是 partylist 则为 True，否则为 False<img src="C:\Users\29310\AppData\Roaming\Typora\typora-user-images\image-20221130085412684.png" alt="image-20221130085412684"></li>
<li>**<code>getMaxLength</code>**返回一个数值，指示字符串或备忘录属性的最大长度<img src="C:\Users\29310\AppData\Roaming\Typora\typora-user-images\image-20221130085523849.png" alt="image-20221130085523849"></li>
<li>**<code>getName</code>**返回当前的逻辑名称</li>
<li>**<code>getParent</code>**返回 <code>Xrm.Page.data.entity</code> 对象，该对象为所有属性的父对象<img src="C:\Users\29310\AppData\Roaming\Typora\typora-user-images\image-20221130085953719.png" alt="image-20221130085953719"></li>
<li>**<code>getUserPrivilege</code>**查看权限创建、读取或更新<img src="C:\Users\29310\AppData\Roaming\Typora\typora-user-images\image-20221130090151838.png" alt="image-20221130090151838"></li>
</ul>
</li>
</ul>
</li>
<li><p><strong><code>Xrm.page.data.process对象</code></strong></p>
<ul>
<li><p>**<code>getActiveProcess</code>**返回流程对象<img src="C:\Users\29310\AppData\Roaming\Typora\typora-user-images\image-20221130091219756.png" alt="image-20221130091219756"></p>
</li>
<li><p>**<code>getActiveStage</code>**返回阶段<img src="C:\Users\29310\AppData\Roaming\Typora\typora-user-images\image-20221130091918272.png" alt="image-20221130091918272"></p>
</li>
</ul>
</li>
</ul>

</div>


    <div class="post-guide">
        <div class="item left">
            
              <a href="/wl/2023/02/24/%E6%9C%AC%E5%9C%B0%E5%AE%89%E8%A3%85vm%E9%81%87%E5%88%B0%E9%97%AE%E9%A2%98%E7%AC%94%E8%AE%B0/">
                  <i class="fa fa-angle-left" aria-hidden="true"></i>
                  本地安装vm遇到问题笔记
              </a>
            
        </div>
        <div class="item right">
            
              <a href="/wl/2022/11/28/Markdown%E8%AF%AD%E6%B3%95/">
                
                <i class="fa fa-angle-right" aria-hidden="true"></i>
              </a>
            
        </div>
    </div>



	<div id="vcomments"></div>


<script>
	
</script>
	</div>
	<div id="footer">
	<p>
	©2019-<span id="footerYear"></span> 
	<a href="/">John Doe</a> 
	
	
		|
		<span id="busuanzi_container_site_pv">
			pv
			<span id="busuanzi_value_site_pv"></span>
		</span>
		|
		<span id="busuanzi_container_site_uv"> 
			uv
			<span id="busuanzi_value_site_uv"></span>
		</span>
	
	<br>
	Theme <a href="//github.com/wujun234/hexo-theme-tree" target="_blank">Tree</a>
	by <a href="//github.com/wujun234" target="_blank">WuJun</a>
	Powered by <a href="//hexo.io" target="_blank">Hexo</a>
	</p>
</div>
<script type="text/javascript"> 
	document.getElementById('footerYear').innerHTML = new Date().getFullYear() + '';
</script>
	<button id="totop-toggle" class="toggle"><i class="fa fa-angle-double-up" aria-hidden="true"></i></button>
</body>
</html>